package domain.model.requestInvite.mapper;

import java.sql.SQLException; 

import org.dsrg.soenea.domain.MapperException;
import org.dsrg.soenea.domain.mapper.IOutputMapper;

import domain.model.invite.Invite;
import domain.model.requestInvite.RequestInvite;
import domain.model.requestInvite.data.RequestInviteTDG;

public class RequestInviteOutputMapper implements IOutputMapper<Long, RequestInvite>{

	/*
	public static int insert(RequestInvite requestInvite) throws SQLException
	{
			return RequestInviteTDG.insert( requestInvite.getUser().getId(), requestInvite.getGroup().getId() );
	}

	public static int delete(RequestInvite requestInvite) throws SQLException
	{
			return RequestInviteTDG.delete(requestInvite.getUser().getId(), requestInvite.getGroup().getId(), requestInvite.getVersion());
	}

	 */

	@Override
	public void insert(RequestInvite requestInvite) throws MapperException {
		try
		{
			RequestInviteTDG.insert( requestInvite.getUser().getId(), requestInvite.getGroup().getId() );
		} 
		catch (SQLException e)
		{
			e.printStackTrace();
			throw new MapperException(e.getMessage());
		}

	}

	@Override
	public void update(RequestInvite d) throws MapperException {
		// TODO Auto-generated method stub

	}

	@Override
	public void delete(RequestInvite requestInvite) throws MapperException {
		try
		{
			RequestInviteTDG.delete(requestInvite.getUser().getId(), requestInvite.getGroup().getId(), requestInvite.getVersion());
		} 
		catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			throw new MapperException(e.getMessage());
		}
	}

	@Override
	public void cascadeInsert(RequestInvite d) throws MapperException {
		// TODO Auto-generated method stub

	}

	@Override
	public void cascadeUpdate(RequestInvite d) throws MapperException {
		// TODO Auto-generated method stub

	}

	@Override
	public void cascadeDelete(RequestInvite d) throws MapperException {
		// TODO Auto-generated method stub

	}

	@Override
	public void validateInsert(RequestInvite d) throws MapperException {
		// TODO Auto-generated method stub

	}

	@Override
	public void validateUpdate(RequestInvite d) throws MapperException {
		// TODO Auto-generated method stub

	}

	@Override
	public void validateDelete(RequestInvite d) throws MapperException {
		// TODO Auto-generated method stub

	}

}
